#!/bin/sh


data=$(timeout 1 cat /dev/ttyUSB0)
#    echo "Debug: 当前处理的命令为 $data"
if echo "$data" | grep -q "reboot"; then
   echo "接收到的信息：reboot"
   reboot
elif echo "$data" | grep -q "poweroff"; then
   echo "接收到的信息：poweroff"
   poweroff
else
   echo "接收到的信息：其他无效信息"
fi